package com.smileus.service;

import java.util.List;

import com.smileus.entity.ServiceInfo;

/**
 * 
 * @author dongheng
 * 
 */

@SuppressWarnings("unchecked")
public class ServiceInfoService extends BaseService {
	/**
	 * serviceId由sysDomain和service组成，形式为:katong.userService.add形式
	 * 
	 * @param serviceId
	 * @return
	 */
	private static final String SERVICE_INFO_HQL = " from ServiceInfo si where si.sysDomain =? and si.service = ? ";

	public ServiceInfo getServiceInfo(String sysDomain, String service) {
		List<ServiceInfo> list = getHibernateDAO().queryByParam(SERVICE_INFO_HQL, sysDomain, service);
		if (list != null && list.size() == 1) {
			return list.get(0);
		}
		throw new RuntimeException(sysDomain + "." + service + "配置信息不对，请检查。");
	}
}
